package com.gel.shortLink.admin.config;

import com.gel.shortLink.admin.common.biz.UserTransmitHandler;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@RequiredArgsConstructor
public class WebConfig implements WebMvcConfigurer {

    private final UserTransmitHandler userTransmitHandler;

    @Override
    public void addInterceptors(InterceptorRegistry  registry) {
        registry.addInterceptor(userTransmitHandler)
                .addPathPatterns("/**")
                .excludePathPatterns("/api/short-link/admin/user/login", "/api/short-link/admin/user/register","/api/short-link/admin/user/hasUserName");
    }
}
